//
//  MYRouter.h
//  HZTC_Stock
//
//  Created by MayerF on 2017/5/24.
//  Copyright © 2017年 MayerF. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef id (^MYRouterBlock)(NSDictionary *params, id other);

@interface MYRouter : NSObject

+ (instancetype)shared;
//注册控制器
- (void)map:(NSString *)route toControllerClass:(Class)controllerClass;
//匹配控制器
- (UIViewController *)matchController:(NSString *)route;
//匹配带参数的控制器
- (UIViewController *)matchController:(NSString *)route params:(NSDictionary *)params;

//注册block
- (void)map:(NSString *)route toBlock:(MYRouterBlock)block;
//匹配block
- (MYRouterBlock)matchBlock:(NSString *)route;
//删除block
//因为单例强引用代码块，建议代码块不需要的时候删除。
- (void)matchDeleteBlock:(NSString *)route;

@end


///--------------------------------
/// @name UIViewController Category
///--------------------------------

@interface UIViewController (MYRouter)

@property (nonatomic, strong) NSDictionary *params;

@end
